from socket import *

HOST = 'localhost'
PORT = 9000
ADDR = (HOST, PORT)

socketCli = socket(AF_INET,SOCK_STREAM)
socketCli.connect(ADDR)

while True:
    data = raw_input('> ')
    if not data:
        break
    socketCli.send(data)
    data = socketCli.recv(1024)
    if not data:
        break
    print "recv =",data

socketCli.close()

